Repository navigation
fix(plugin-calendar): name the object by its label when a reschedule finds the record gone - #31528
Conversation
…finds the record gone A drag-to-reschedule refused with 404 RECORD_NOT_FOUND toasted the server's own sentence (record id plus the object's machine name, in English). It now toasts calendar.rescheduleNotFound with the object's served label (else the app's translation of it, else the generic form.recordNotFoundOrHidden), and the event still rolls back. Marked, external-source and permission refusals keep their own messages ahead of it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jSxTNXbFBqyMe2bkhV
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo Contract reviewServed-tier: The lane seat's own review of record, owed by the ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo 席位核对 · ACCEPT · 2026-11-08T13:34Z · head
|
Requested by Steedos · project thread
Fixes #31494
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
Record WB5z1sLAsWgE1tXL not found in showcase_task这样的英文系统句,违反「显示名称优先于机器名」规范(QA QA run · owed:weekly (73/73) · 0647dabb · 2026-11-08 · 61 PASS / 7 PARTIAL / 4 FAIL / 1 BLOCKED / 0 NOT-RUN #31486)。ui/packages/plugin-calendar/src/ObjectCalendar.tsx(新分支与isRecordNotFound)、ObjectCalendar.markedRefusalToast.test.tsx(新 describe)、ui/packages/i18n/src/locales/zh-Hans.ts(新键译文)。cd ui && pnpm exec vitest run packages/plugin-calendar/src/ObjectCalendar.markedRefusalToast.test.tsx,预期 12 个用例全绿,其中 zh 用例读到「这条任务记录已不存在,或者您已无权访问它。」What changes
@object-ui/plugin-calendar:handleEventDropDefault's toast chain gains one branch after the permission branch and beforeextractWriteErrorMessage: a refusal whose code (on the error or itsdetails) isRECORD_NOT_FOUND, or whose status is 404, toastscalendar.rescheduleNotFoundwith the object named by its label. The label is the object schema's servedlabel(already translated server-side), else the app's convention-key translation viauseSafeFieldLabel().objectLabel, else no name at all: the toast then says the existingform.recordNotFoundOrHiddensentence. The server's sentence, the record id and the machine name never reach the toast. The rollback of the optimistic move is unchanged. The classifier is a small module-localisRecordNotFoundbuilt onerrorCodeIsfrom@object-ui/types:is404Errorlives in@object-ui/data-objectstack, which this package has only as a devDependency, so reusing it would have meant a new runtime dependency edge.@object-ui/i18n: one new key,calendar.rescheduleNotFound, in all elevenlocales/*.tspacks; zh-Hant generated from zh-Hans withgen:zh-hant. The sentence takes one placeholder, the object label.extractWriteErrorMessageis not touched (no caller census needed).Tests
New top-level describe in the existing harness
ObjectCalendar.markedRefusalToast.test.tsx(wire-shaped errors through the realnormaliseClientError, real MonthView drag):I18nProviderwith the label 任务: the toast is the zh sentence.form.recordNotFoundOrHiddensentence, no machine name.userMessagestill renders the marking.The test's drop-target lookup moved from the spoken cell label to the day number of the current-month cell, so the zh render finds it too; the previous
cellLabelhelper is removed.Acceptance notes
extractWriteErrorMessage(11 non-test files underui/packagesandui/appscall it,git grepat d15c0ad). Not changed here; the card scoped the fix to the calendar toast.Verification
Local runs at a934d10 (suites re-run at d15c0ad)
vitest run packages/plugin-calendar/src/ObjectCalendar.markedRefusalToast.test.tsx: 12/12 passed.vitest run packages/plugin-calendar/ packages/i18n/: Test Files 167 passed, Tests 2312 passed, 108 skipped.turbo run type-check --filter=@object-ui/plugin-calendar --filter=@object-ui/i18n: 53/53 tasks successful.eslinton the two calendar files: 0 errors (warnings all on untouched lines).scripts/ablation-replace.mjs, theisRecordNotFound(err)condition replaced byfalse): 3 failed, 9 passed; the three new not-found cases receivedRecord v1 not found in visit; restore verified blob == HEAD,git diff HEADempty.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 38 families; all 38 ran at a934d10 and exited 0;--ranreconciliation: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.After merging main (head d15c0ad, the derived list unchanged), the ratchet and suite families were re-run: all exit 0, and the calendar + i18n suites again passed 167/167 files.
Generated by Claude Code